home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / sm32a.zip / LIBRARY / LSOLVE.LI2 < prev    next >
Text File  |  1994-09-21  |  359b  |  8 lines

  1. #    psolve() is polynomial solver
  2. #    e.g. psolve(x^2+5*x+6, x) gives [-2, -3]
  3.  
  4. lsolve(eq1_, eq2_, x_, y_) := if(order(eq1,x) == 1 and order(eq1,y) ==1,
  5.     block(dd:=coef(eq1,x,1)*coef(eq2,y,1)-coef(eq1,y,1)*coef(eq2,x,1),
  6.     [x==(coef(eq1,x,1)*coef(eq2,x,0)-coef(eq1,x,0)*coef(eq2,x,1)/dd,
  7.      y==(coef(eq1,y,1)*coef(eq2,y,0)-coef(eq1,y,0)*coef(eq2,y,1)/dd] ))
  8.